﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace TienLen
{
    public partial class MSNChatMain : UserControl
    {
        public MSNChatMain()
        {
            InitializeComponent();
        }

        public void AddTab(Control control, string name, string text)
        {
            if (control is MSNConvo && tabs.TabPages.ContainsKey(name))
            {
                tabs.SelectedIndex = tabs.TabPages.IndexOfKey(name);
                return;
            }

            tabs.TabPages.Add(name, text);

            tabs.TabPages[tabs.TabPages.Count - 1].Controls.Add(control);
            tabs.TabPages[tabs.TabPages.Count - 1].Controls[0].Dock = DockStyle.Fill;

            tabs.SelectedIndex = tabs.TabPages.Count - 1;
        }
    }
}
